package com.example.security;

import lombok.Getter;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

@Getter
public class CustomAuthenticationToken extends UsernamePasswordAuthenticationToken {

    private final String uid;

    public CustomAuthenticationToken(Object principal, Object credentials, String uid) {
        super(principal, credentials);
        this.uid = uid;
    }

    public CustomAuthenticationToken(Object principal, Object credentials, String uid, Collection<? extends GrantedAuthority> authorities) {
        super(principal, credentials, authorities);
        this.uid = uid;
    }

}
